﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace WaveMaster.Holidays.Club.SQL
{
    public class SeaPortSQL
    {
        public static string GetAllSeaPort()
        {
            string sql = "select * from seaport";
            return sql;
        }

        public static string GetAllActiveSeaPort()
        {
            string sql = "select * from seaport where m_active = 'True'";
            return sql;
        }

        public static string GetSeaPortByID()
        {
            string sql = "select * from seaport where m_seaPortID = ?m_seaPortID ";
            return sql;
        }
        public static string SearchSeaPortByCodeName(string p)
        {
            string sql = "select * from seaport WHERE concat(m_seaPortCode,m_seaPortName) like '%" + p + "%'";
            return sql;
        }
        public static string DeleteSeaPortByID()
        {
            return @"DELETE FROM seaport
      WHERE m_seaPortID = ?m_seaPortID";
        }
        public static string InsertSeaPort()
        {
            string sql = @"INSERT INTO seaport
           (m_seaPortCode
           ,m_seaPortName
            ,m_country
            ,m_remark
           ,m_cretnDate            
            ,m_cretnBy
            ,m_modfctnDate
            ,m_modfctnBy
             ,m_active
            )
     VALUES
           (?m_seaPortCode
           ,?m_seaPortName
            ,?m_country
            ,?m_remark
            ,?m_cretnDate
            , ?m_cretnBy
            , ?m_modfctnDate
            ,?m_modfctnBy
            ,?m_active)";
            return sql;
        }
        public static string UpdateSeaPort()
        {
            string sql = @"UPDATE seaport
   SET m_seaPortCode=?m_seaPortCode
           ,m_seaPortName=?m_seaPortName
            ,m_country=?m_country
            ,m_remark=?m_remark
            ,m_modfctnDate=?m_modfctnDate
            ,m_modfctnBy=?m_modfctnBy
            ,m_active=?m_active
 WHERE m_seaPortID = ?m_seaPortID";
            return sql;
        }
    }
}
